import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '项目',
    align:"left",
    dataIndex: 'projectId_dictText',
     width: 400
   },
  {
    title: '项目序号',
    align:"left",
    dataIndex: 'sortNo'
  },
   {
    title: '出差费用申请总额',
    align:"center",
    dataIndex: 'totalTripAmount'
   },
  {
    title: '报销类型',
    align:"center",
    dataIndex: 'type_dictText'
  },
  {
    title: '申请人',
    align:"center",
    dataIndex: 'realName'
  },
  {
    title: '所属客户',
    align:"center",
    dataIndex: 'customId_dictText'
  },
  {
    title: '费用申请状态',
    align:"center",
    dataIndex: 'status_dictText'
  },
/*  {
    title: '行政审批状态',
    align:"center",
    dataIndex: 'applyStatus_dictText'
  },*/


];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'projectId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_roc_project_setup,project_name,id'
    },
    label: '项目名称',
    colProps: { span: 4 },
  },
  {
    label: '项目序号',
    field: 'sortNo',
    component: 'JInput',
    colProps: { span: 4 },
  },
  {
    field: 'customId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_custom,name,id'
    },
    label: '所属客户',
    colProps: { span: 4 },
  },
  {
    label: '报销类型',
    field: 'type',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'tripType',
      stringToNumber: true,
    },
    colProps: { span: 4 },
  },

  {
    label: '审核状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'officeSApplyStatus',
      stringToNumber: true,
    },
    colProps: { span: 5 },
  },


];
//表单数据
export const formSchema: FormSchema[] = [
  {
    field: 'projectId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_roc_project_setup,project_name,id,setup_status=3 and project_status=1'
    },
    label: '项目',
  },

  {
    label: '出差费用申请总额',
    field: 'totalTripAmount',
    component: 'InputNumber',
  },
/*  {
    label: '税点',
    field: 'fax',
    component: 'InputNumber',
  },*/
 {
    label: '报销类型',
    field: 'type',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'tripType',
      stringToNumber: true,
    },
  },
  /*
  {
    label: '行政审批状态',
    field: 'applyStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'applyStatus',
      stringToNumber: true,
    },
  },*/
/*  {
    label: '报销类型',
    field: 'type',
    component: 'InputNumber',
  },*/

  {
    field: 'uploadFile',
    component: 'JUpload',
    helpMessage: '附件上传',
    label: '附件上传',
    componentProps:{
      returnUrl: false
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

export const tripFormSchema: FormSchema[] = [
  {
    field: 'projectId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_roc_project_setup,project_name,id'
    },
    label: '项目',
  },

  {
    label: '出差费用申请总额',
    field: 'totalTripAmount',
    component: 'InputNumber',
  },
  {
    label: '税点',
    field: 'fax',
    component: 'InputNumber',
  },
/*  {
    label: '费用申请状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'submitStatus',
      stringToNumber: true,
    },
  },
  {
    label: '行政审批状态',
    field: 'applyStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'applyStatus',
      stringToNumber: true,
    },
  },*/
/*  {
    label: '报销类型',
    field: 'type',
    component: 'InputNumber',
  },*/

  {
    field: 'uploadFile',
    component: 'JUpload',
    helpMessage: '附件上传',
    label: '附件上传',
    border: 'left',
    componentProps:{
      returnUrl: false
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

export const tripFormSchemas: FormSchema[] = [
  {
    field: 'projectId',
    component: 'Input',
    componentProps: {
      dictCode: 'monster_roc_project_setup,project_name,id'
    },
    label: '项目',
  },

  {
    label: '出差费用申请总额',
    field: 'totalTripAmount',
    component: 'InputNumber',
  },
  {
    field: 'uploadFile',
    component: 'JUpload',
    helpMessage: '附件上传',
    label: '附件上传',
    componentProps:{
      returnUrl: false
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];


/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
